function [A,Y,D] = getVerticalPoint(a,b,c)
%GETVERTICALPOINT Summary of this function goes here
%   A gives out the point position; Y = 1 for verticalpoints within ab, 0
%   for out.

a=[a 0];
b=[b 0];
c=[c 0];
ab=b-a;
ac=c-a;

e=cross(cross(ac,ab),ab);
e=e/norm(e); 

d=c-e*ac'*e;
A=[d(1),d(2)];
if (c(1)-a(1))*(b(1)-a(1))+(c(2)-a(2))*(b(2)-a(2))>0 && (c(1)-b(1))*(a(1)-b(1))+(c(2)-b(2))*(a(2)-b(2))>0
    Y=1;
    D=(c(1)-A(1))^2+(c(2)-A(2))^2;
else
    Y=0;
    D=(c(1)-A(1))^2+(c(2)-A(2))^2;
end
end

